package top.healthylife.gateway.platform.geo.api.check;

import org.springframework.stereotype.Service;
import top.healthylife.basics.utils.exception.BusinessException;
import top.healthylife.gateway.core.config.BaseConfig;
import top.healthylife.gateway.core.service.CheckSecretService;
import top.healthylife.gateway.platform.geo.api.config.SystemConfig;
import top.healthylife.gateway.platform.geo.api.util.client.Client;

/**
 * @author : GaoZeXi
 * @date 2021/3/19 14:48
 */
@Service
public class CheckSecretServiceImpl implements CheckSecretService {
    @Override
    public void checkSecret(BaseConfig baseConfig) {
        SystemConfig geo = (SystemConfig) baseConfig;
        try {
         new Client(geo).getToken(true);
        }catch (Exception e){
            throw new BusinessException("账号校验不通过");
        }
    }
}
